<!DOCTYPE html>
<html lang="zh">
{include file="public/head"}
<link rel="stylesheet" type="text/css" href="/static/admin/js/webuploader/webuploader.css">
<body>
<div class="container-fluid">
  <div class="row">
    <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <div class="card-title">下单用户信息</div>
        </div>
        <div class="card-body">
            <div class="d-flex">
              <img src="{$user_info.avatar}" class="rounded-circle me-3" style="width: 80px;height: 80px">
            </div>
            <hr>
            <div class="mb-2">
              <label>下单用户名：</label>
              <label>{$user_info.username}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>用户信息：</label>
              <label>邮箱：{$user_info.mail} ; 学校：{$user_info.school} ; 专业：{$user_info.major} ; 年级：{$user_info.grade} ; 
              排名：{$user_info.rank} </label>
            </div>
            <hr>
            <div class="mb-2">
              <label>能力：</label>
              <label>GPA：{$user_info.gpa} ; 托福：{$user_info.toefl} ; 雅思：{$user_info.ielts} ; LSAT：{$user_info.lsat} ; GRE{$user_info.gre}  </label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>交换项目：</label>
              <label>{$user_info.exchange_country} - {$user_info.exchange_project} - {$user_info.exchange_time}</label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>学业：</label>
              <label>本科：{$user_info.ug_degree} - {$user_info.ug_major} - {$user_info.ug_graduation};  研究生：{$user_info.gd_degree} - {$user_info.gd_major} - {$user_info.gd_graduation}  </label>
            </div> 
            <hr>
            <div class="mb-2">
              <label>目标学校：</label>
              <label>{$user_info.target_school}; 目标专业：{$user_info.target_major}</label>
            </div> 
            <hr>
        </div>
      </div>
    </div>

    <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <div class="card-title">订单详情</div>
        </div>
        <div class="card-body">
            <div class="mb-2">
              <label>订单单号：</label>
              <label>{$order_info.order_data.order_no}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>服务类型：</label>
              <label>{$order_info.order_data.service_name}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>用户选择时间段：</label>
              <label>{volist name="$order_info.order_server_data.expected_time" id="v" key="k"} ({$k}) {$v|date="Y-m-d H:i:s"} {/volist}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>咨询内容：</label>
              <label>{$order_info.order_server_data.content}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>订单备注：</label>
              <label>{$order_info.order_data.remark}</label>
            </div>
            <hr>
            <div class="mb-2">
              <label>图片附件：</label>
              <label>
                  {volist name="order_info.order_server_data.enclosure_img" id="v"}
                    <a href="{$v}" target="_blank"><img src="{$v}" style="width: 60px;height: 60px"></a>
                  {/volist}
              </label>
            </div>
            <hr>
            <div class="mb-2">
              <label>文件附件：</label>
              <label>
                  {volist name="order_info.order_server_data.enclosure_file" id="v"}
                    <a href="{$v}" class="link-primary" target="_blank">{$v}</a>
                  {/volist}
              </label>
            </div>
            <hr>
        </div>
      </div>
    </div>

  </div>

  <div class="row">

    <div class="col-lg-12">
      <div class="card">
        <header class="card-header">
          <div class="card-title">订单服务信息</div>
        </header>
        <div class="card-body">
          <form class="row" id="common_form" action="{$action}" method="post">

            <div class="mb-3 col-md-12">
              <label for="expected_time" class="form-label">
                <h6>第一步：待用户上传资料,确认服务时间段</h6>
              </label>
              <div class="clearfix">
                <label class="form-label">请确认服务时间：</label>
                {volist name="$order_info.order_server_data.expected_time" id="v"}
                <div class="form-check form-check-inline">
                  <input type="radio" id="expected_time" name="confirm_time" class="form-check-input" value="{$v|strtotime}" {if $order_info.order_server_data.confirm_time == $v}checked {/if} {notempty name="$order_info.order_server_data.confirm_time"}disabled=""{/notempty}>
                  <label class="form-check-label" for="expected_time">{$v}</label>
                </div>
                {/volist}
              </div>

              {if !empty($order_info.order_server_data.name) && !empty($order_info.order_server_data.phone) && !empty($order_info.order_server_data.wx_number) && !empty($order_info.order_server_data.school)}
              <div class="mb-3">
                <label for="upload_size" class="form-label">用户资料：</label>
                <div class="row">
                  <div class="col">
                    <label for="inputZip" class="form-label">手机号：</label>
                    <input type="text" class="form-control" value="{$order_info.order_server_data.phone}" aria-label="phone">
                  </div>
                  <div class="col">
                    <label for="inputZip" class="form-label">微信号：</label>
                    <input type="text" class="form-control" value="{$order_info.order_server_data.wx_number}" aria-label="wx_number">
                  </div>
                  <div class="col">
                    <label for="inputZip" class="form-label">称呼：</label>
                    <input type="text" class="form-control" value="{$order_info.order_server_data.name}" aria-label="name">
                  </div>
                  <div class="col">
                    <label for="inputZip" class="form-label">专业：</label>
                    <input type="text" class="form-control" value="{$order_info.order_server_data.major}" aria-label="major">
                  </div>
                  <div class="col">
                    <label for="inputZip" class="form-label">年级：</label>
                    <input type="text" class="form-control" value="{$order_info.order_server_data.grade}" aria-label="grade">
                  </div>
                </div>
              </div>
              {/if}
            </div>
            <input type="hidden" name="message_step" value="1">

            {if !empty($order_info.order_server_data.confirm_time) && $order_info.order_server_data.user_is_confirm == 0}
            <div class="mb-3 col-md-12">
              <label for="confirm_time" class="form-label text-danger">
                <h6>第二步：等待用户确认服务时间</h6>
              </label>
            </div>
            <input type="hidden" name="confirm_time" value="{:strtotime($order_info.order_server_data.confirm_time)}">
            {/if}
            {if !empty($order_info.order_server_data.confirm_time) && $order_info.order_server_data.user_is_confirm == 1}
            <div class="mb-3 col-md-12">
              <label for="confirm_time" class="form-label text-success">
              <h6>第二步：用户已经确认服务时间</h6>
              </label>
            </div>
            {/if}

            {if !empty($order_info.order_server_data.confirm_time) && $order_info.order_server_data.user_is_confirm == 1}
            <label for="price" class="form-label">
              <h6>第三步：上传会议链接：</h6>
            </label>
            <div class="input-group mb-3">
              <span class="input-group-text">会议链接</span>
              <input type="text" class="form-control" name="meeting_link" placeholder="请输入会议链接" value="{$order_info.order_server_data.meeting_link}" required>
              <span class="input-group-text">会议密码</span>
              <input type="text" class="form-control" name="meeting_pwd"  placeholder="请输入会议密码" value="{$order_info.order_server_data.meeting_pwd}">
            </div>

            <input type="hidden" name="message_step" value="2">
            {/if}

            {if !empty($order_info.order_server_data.meeting_link)}
            <div class="mb-3 col-md-12">
              <label for="meeting_link" class="form-label">
              <h6>第四步：会议进行中</h6>
              </label>
            </div>
            {/if}

            {if $order_info.order_data.status == 4}
            <div class="mb-3 col-md-12">
              <label for="meeting_link" class="form-label">
              <h6>第五步：服务已完成，服务完成时间：{$order_info.order_data.complete_time}</h6>
              </label>
            </div>
            {/if}

            <!-- <div class="mb-3 col-md-12">
              <label for="expected_time" class="form-label">上传附件</label>
              <div class="clearfix">
                <div class="filePicker">选择文件</div>
                <label id="file_name"></label>
                <label id="file_size">&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <label id="file_time">&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <div class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">0%</div>
              </div>
            </div> -->
            <input type="hidden" name="service_name" value="{$order_info.order_data.service_name}">
            <input type="hidden" name="id" value="{$order_info.order_data.id}">
            <input type="hidden" id="jump_url" value="self">

            {if $order_info.order_data.status == 1}
            <div class="mb-3 col-md-12">
              <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
              <button type="button" class="btn btn-default" id="close_layer_open">返 回</button>
              <button type="button" class="btn btn btn-teal" id="refresh_page">
                <i class="mdi mdi-file-refresh"></i>刷新页面
              </button>
              <button type="button" class="btn btn-success order-complete">
                <i class="mdi mdi-checkbox-marked-circle-outline"></i>设置订单为已完成
              </button>
            </div>
            {/if}
          </form>
        </div>
      </div>
    </div>

  </div>

</div>
{include file="public/script"}
<script type="text/javascript" src="/static/admin/laydate/laydate.js"></script>
<script type="text/javascript" src="/static/admin/js/webuploader/webuploader.js"></script>
<script type="text/javascript">

var GUID = WebUploader.Base.guid();
// 初始化Web Uploader
var uploader = WebUploader.create({
    // 选完文件后，是否自动上传。
    auto: true,
    // swf文件路径
    swf: '/static/admin/js/webuploader/Uploader.swf',
    // 文件接收服务端。
    server: '/admin/common/chunkUpload',
    pick: {
        id:'.filePicker',
        //是否开启多个文件选择能力
        multiple:false,
    },
    chunked: true,   //开启分片上传
    chunkSize: 2*1024*1024,   //分片大小
    threads: 1,               //上传并发数。允许同时最大上传进程数。
    formData: {guid: GUID, is_chunk:1},   //guid：任务号
    //fileSingleSizeLimit:30*1024*1024,  //文件大小限制
    fileVal:'file',
    duplicate: true,  //可否可以重复上传相同文件（如果为true，则相同文件可以重复上传）
});

uploader.on('uploadProgress',function (file,percentage ) {
    //显示进度条
    show_rate = Math.floor(percentage* 100);
    $('.progress-bar').css({width:show_rate+'%'});
    $('.progress-bar').text(show_rate+'%');
})

//上传成功时的回调方法
uploader.on('uploadSuccess',function (file,res) {
    if(res.code == 100)
    {
        //$('#file_path').html('&nbsp;&nbsp;&nbsp;&nbsp;文件地址：'+res.data.file_path);
        //$('#file_path').attr('href', res.data.file_path);
        $('#file_name').text('文件名称：'+res.data.file_name);
        $('#file_size').html('&nbsp;&nbsp;&nbsp;&nbsp;文件大小：'+res.data.size);
        $('#file_time').html('&nbsp;&nbsp;&nbsp;&nbsp;上传时间：'+res.data.time);
    }else{
        
    }
})
</script>

<script type="text/javascript">
laydate.render({
  elem: '#payment_time'
  ,type: 'datetime'
  ,theme: '#007BFF'
});

$('.order-complete').click(function(){
    layer.confirm('确定设置此订单为已完成吗?', function(index){
        $.post('/admin/expertOrder/setOrderComplete',{id:{$order_info.order_data.id}},function(res)
        {
            if(res.code == 200)
            {
                showNotify(res.msg, 'success', 1000, 'mdi mdi-emoticon-happy', 'top', 'right', '{$action}');

                $("#table").bootstrapTable('selectPage', $("#table").bootstrapTable("getOptions").pageNumber);  //跳转到此页
            }else{
                showNotify(res.msg, 'danger', 1000, 'mdi mdi-information-outline', 'top', 'right');
            }
        })
        layer.close(index);
    })
})
</script>
</body>
</html>